import request from "../utils/request";

//登录
export function login(zm) {
  return request({
    url: "/admin/ulc/zm",
    method: "post",
    data: { zm },
    headers: {
      ms: localStorage.getItem("zm"),
      // withCredentials: true
    },
  });
}
//登出
export function loginout(param) {
  return request({
    url: "/admin/ulc/zOut",
    method: "post",
    data: param,
  });
}
// 文件上传
export function upload(param) {
  return request({
    url: "/fe/fileUpload",
    method: "post",
    data: param,
    headers: {
      "Content-Type": "multipart/form-data",
      // withCredentials: true
    },
  });
}
// 文件上传
export function ossUpload(param) {
  return request({
    url: "/fe/aliFileUpload",
    method: "post",
    data: param,
    headers: {
      "Content-Type": "multipart/form-data",
      // withCredentials: true
    },
  });
}
//修改后台用户信息
export function editUser(param) {
  return request({
    url: "/admin/usersAppConfig/update",
    method: "post",
    data: param,
  });
}
//修改后台用户信息
export function editUser2(param) {
  return request({
    url: "/admin/ulc/op",
    method: "post",
    data: param,
  });
}
//获取后台用户信息
export function getUser(param) {
  return request({
    url: "/admin/usersAppConfig/select",
    method: "post",
    data: param,
  });
}
//获取用户管理列表
export function subList(param) {
  return request({
    url: "/admin/subscribers/subList",
    method: "post",
    data: param,
  });
}
//获取用户管理列表
export function capital(param) {
  return request({
    url: "/web/capital/m",
    method: "post",
    data: param,
  });
}
//添加新用户
export function createUser(param) {
  return request({
    url: "/admin/subscribers/subC",
    method: "post",
    data: param,
    headers: {
      ms: sessionStorage.getItem("password"),
      // withCredentials: true
    },
  });
}
//冻结、解冻用户
export function subDJ(param) {
  return request({
    url: "/admin/subscribers/subDJ",
    method: "post",
    data: param,
    headers: {
      ms: sessionStorage.getItem("password"),
      // withCredentials: true
    },
  });
}
//删除用户
export function updateSub(param) {
  return request({
    url: "/admin/subscribers/update",
    method: "post",
    data: param,
    headers: {
      ms: sessionStorage.getItem("password"),
      // withCredentials: true
    },
  });
}

//手动更改上级
export function manualLevel(param) {
  return request({
    url: "/admin/subscribers/manualLevel",
    method: "post",
    data: param,
    headers: {
      ms: sessionStorage.getItem("password"),
      // withCredentials: true
    },
  });
}

//修改释放比例
export function updateReleaseRatio(param) {
  return request({
    url: "/admin/subscribers/updateReleaseRatio",
    method: "post",
    data: param,
  });
}
//获取用户管理列表
export function update(param) {
  return request({
    url: "/admin/subscribers/update",
    method: "post",
    data: param,
  });
}
//获取用户下级列表
export function subN(param) {
  return request({
    url: "/admin/subscribers/subN",
    method: "post",
    data: param,
  });
}

//根据用户登录名获取用户密码
export function subPa(param) {
  return request({
    url: "/admin/subscribers/subPa",
    method: "post",
    data: param,
    headers: {
      ms: sessionStorage.getItem("password"),
      // withCredentials: true
    },
  });
}

//获取用户管理列表
export function capitalAds(param) {
  return request({
    url: "/web/capital/ads",
    method: "post",
    data: param,
  });
}
//获取用户管理列表
export function info(param) {
  return request({
    url: "/web/index/info",
    method: "post",
    data: param,
  });
}
//获取用户管理列表
export function homeJ(param) {
  return request({
    url: "/web/home/j",
    method: "post",
    data: param,
  });
}

//修改密码
export function updatePass(param) {
  return request({
    url: "/admin/subscribers/updatePass",
    method: "post",
    data: param,
  });
}

//修改密码
export function capitalFu(param) {
  return request({
    url: "/web/capital/fu",
    method: "post",
    data: param,
  });
}

//修改密码
export function api(param, data) {
  return request({
    url: param,
    method: "post",
    data: data,
  });
}

//修改密码
export function apiEx(param, data) {
  return request({
    url: param,
    method: "post",
    data: data,
    responseType: "blob",
    withCredentials: true,
  });
}

export function getApi(param, data) {
  return request({
    url: param,
    method: "get",
    data: data,
  });
}
